//
//  NewJiesuanViewController.m
//  wangzhe
//
//  Created by 李 佳伟 on 2018/3/22.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "NewJiesuanViewController.h"
#import "JTCSM.h"
#import "MyInfoView.h"
#import "NewJieSuanChangeViewController.h"
static CGFloat myinfoHeight = 50;
static CGFloat imageWidthBili = 0.9637;

@interface NewJiesuanViewController ()
{
   CGFloat space ;
}
@property (nonatomic,strong) UIImageView *bankLogoImageV;
@property (nonatomic,strong) UILabel *bankNameLabel;
@property (nonatomic,strong) UILabel *bankIDLabel;
@property (nonatomic,strong) UILabel *bankUserLabel;


@end

@implementation NewJiesuanViewController

- (void)gotBack{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = NO;
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [df isRemoveTarbar:YES];
    self.navigationController.navigationBar.hidden = NO;
    self.view.backgroundColor =[UIColor whiteColor];
    leftBarButtonItems_rightBarButtonItems *leftbtn = KCUSTOMNAVIGSTION_ALLOC;
    self.navigationItem.leftBarButtonItem = [leftbtn setBarButtonItemsImageName:@"fanhui.png" frame:KLeftBarButtonItemFrame_image target:self SEL:@selector(gotBack)];
    space = 30*[JTCSMSingle shareSingle].adaptationNumber;
    [self layouSubViews];
}

- (void)layouSubViews{
    CGFloat imageWidth = KCONTROLLERWith-2*space;
    CGFloat imageHeight = imageWidth*0.583333;
    CGFloat leftSpace = imageWidth*(1-imageWidthBili)/2;
    CGFloat showHeight = imageHeight*0.95336;
    
    UIImageView *bankImagev = [[UIImageView alloc]initWithFrame:CGRectMake(space, 20+KagainChangeHeight, imageWidth, imageHeight)];
    bankImagev.image = [UIImage imageNamed:@"信用卡还款_绿card.png"];
    [self.view addSubview:bankImagev];
    
    CGFloat logoimagesize = 30;
    CGFloat bankSpace = 20*[JTCSMSingle shareSingle].adaptationNumber;
    self.bankLogoImageV = [[UIImageView alloc]initWithFrame:CGRectMake(bankSpace, bankSpace, logoimagesize, logoimagesize)];
    self.bankLogoImageV.image = [UIImage imageNamed:@""];
    [bankImagev addSubview:self.bankLogoImageV];
    
    self.bankNameLabel = [UILabel initWithFrame:CGRectMake(KVIEW_X(self.bankLogoImageV)+10, _bankLogoImageV.LC_y, bankImagev.LC_width-KVIEW_X(self.bankLogoImageV)-10-leftSpace, _bankLogoImageV.LC_height) text:@"民生银行" font:14 textAlignment:NSTextAlignmentLeft texcolor:[UIColor whiteColor] backgroundColor:nil];
    [bankImagev addSubview:self.bankNameLabel];
    
    self.bankIDLabel = [UILabel initWithFrame:CGRectMake(_bankLogoImageV.LC_x, KVIEW_Y(self.bankLogoImageV)+23, bankImagev.LC_width-2*leftSpace, 20) text:@"8745 **** **** 5498" font:21 textAlignment:NSTextAlignmentLeft texcolor:[UIColor whiteColor] backgroundColor:nil];
    [bankImagev addSubview:self.bankIDLabel];
    
    self.bankUserLabel = [UILabel initWithFrame:CGRectMake(_bankLogoImageV.LC_x, showHeight-_bankLogoImageV.LC_height-20, bankImagev.LC_width-2*leftSpace, _bankLogoImageV.LC_height) text:@"持卡人：李**" font:12 textAlignment:NSTextAlignmentLeft texcolor:[UIColor whiteColor] backgroundColor:nil];
    [bankImagev addSubview:self.bankUserLabel];
    
    NSArray *array = @[@"开户行所在地",@"开户支行",@"银行预留手机号"];
    for (int i = 0; i < array.count; i++) {
        MyInfoView *view2 = [[MyInfoView alloc]initWithFrame:CGRectMake(0, KVIEW_Y(bankImagev)+myinfoHeight+myinfoHeight*i, KCONTROLLERWith, myinfoHeight) imagename:nil title:array[i]placeholder:nil isShowLabel:ImageandlabelViewType radioBtnIndex:0 GroupId:@""];
        view2.tag = 200+i;
        view2.userInteractionEnabled = YES;
//        [df addTapGestureRecognizerWithTarget:self action:@selector(gotoVC:) andaddView:view2];
        [self.view addSubview:view2];
    }
    
    UILabel *alertLabel = [UILabel initWithFrame:CGRectMake(20, KVIEW_Y(bankImagev)+array.count*myinfoHeight+10+myinfoHeight, KCONTROLLERWith-40, 30) text:@"为保证正常结算，请确保结算信息正确" font:12 textAlignment:NSTextAlignmentLeft texcolor:[df colorWithHexString:@"999999" alpha:1] backgroundColor:nil];
    [self.view addSubview:alertLabel];
    
    
    UILabel *bottomeLabel = [UILabel initWithFrame:CGRectMake(0, KCONTROLLERHeight-myinfoHeight, KCONTROLLERWith, myinfoHeight) text:@"更换结算卡" font:16 textAlignment:NSTextAlignmentCenter texcolor:[df colorWithHexString:@"333333" alpha:1] backgroundColor:KZhuTiRGB];
    [self.view addSubview:bottomeLabel];
    [df addTapGestureRecognizerWithTarget:self action:@selector(gotoChangeMybankVC) andaddView:bottomeLabel];
    bottomeLabel.userInteractionEnabled = YES;
    
    
}
- (void)gotoChangeMybankVC{
    NewJieSuanChangeViewController *vc = [[NewJieSuanChangeViewController alloc]init];
    vc.nameTitle = @"更换结算卡须知";
    [self.navigationController pushViewController:vc animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
